<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册</title>
    <script src="/js/vue.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="js/axios.min.js"></script>
<!--    <script src="js/common.js"></script>-->
</head>
<body>
<div id="app">
<table>
    <tr><td>username:</td><td><input name="username" v-model="username"></td></tr>
    <tr><td>password:</td><td><input name="password" v-model="password"></td></tr>
    <tr><td><input type="button" name="register" @click="h_register" value="注册"></td></tr>
</table>
</div>
<script>
    const baseurl = window.location.host;
    const app = new Vue({
        el:"#app",
        data:{
            username:"",
            password:"",
            password_confirm:""
        },
        methods:{
            h_register:function () {
                console.log(baseurl+"/adduser")
                axios.post("HTTP://"+baseurl+"/adduser",{username:this.username,password:this.password}).then(
                    function (response) {
                        // alert(response)
                    },
                    function (err){
                        alert(err)
                    }
                )
            }
        }
    })
</script>
</body>
</html>